{% extends 'template.html' %}
{% block title_content %}
    靓号列表
{% endblock %}

{% block content %}

    <div class="container">
        <!--按钮-->
        <div style="margin-bottom: 10px" class="left">
            <a class="btn btn-success" href="/admin/add/">
                <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
                新建管理员
            </a>
            <!--搜索-->
            <a>
                <form class="navbar-form navbar-right" method="get" action="/admin/list/">
                    <div class="form-group">
                        <input type="text" class="form-control" placeholder="关键字" name="q" value="{{ search_data }}">
                    </div>
                    <button type="submit" class="btn btn-default">搜索</button>
                </form>
            </a>
        </div>
        <div class="panel panel-default">
            <!-- Default panel contents -->
            <div class="panel-heading">
                <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
                管理员账户
            </div>
            <!-- Table -->
            <table class="table table-bordered">
                <thead>
                <th>ID</th>
                <th>用户名</th>
                <th>密码</th>
                <th>重置密码</th>
                <th>操作</th>
                </thead>
                <tbody>
                {% for query in queryset %}
                    <tr>
                        <th>{{ query.id }}</th>
                        <td>{{ query.username }}</td>
                        <td>******</td>
                        <td>
                            <a href="/admin/{{ query.id }}/reset/">重置密码</a>
                        </td>
                        <td>
                            <a class="btn btn-primary btn-xs" href="/admin/{{ query.id }}/edit/">编辑</a>
                            <!--<a class="btn btn-danger btn-xs" href="/admin/delete/?nid={ qurey.id }">删除</a>-->
                            <a class="btn btn-danger btn-xs" href="/admin/{{ query.id }}/delete/">删除</a>
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        </div>
        <!--分页组件-->
        <div class="clearfix">
            <ul class="pagination">
                {{ page_string }}
            </ul>
        </div>
    </div>
{% endblock %}
